* font.c (font_make_object): Avoid dangling pointer which may
authorDmitry Antipov <dmantipov@yandex.ru>
Thu, 19 Jun 2014 03:21:07 +0000 (07:21 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Thu, 19 Jun 2014 03:21:07 +0000 (07:21 +0400)
crash GC (Bug#17771).

src/ChangeLog
src/font.c

index 051adaf8051dfdb7478f6ad8d0a9f33c9bbe0aae..efa0fe4969e5b56ea804c1dd27652f3702cf53e2 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * font.c (font_make_object): Avoid dangling pointer which may
+       crash GC (Bug#17771).
+
 2014-06-18  Eli Zaretskii  <eliz@gnu.org>
 
        * image.c [5 < GIFLIB_MAJOR + (1 <= GIFLIB_MINOR)]: Declare the
index b49664b5f31f6b16c68d7ca3336f42c8252cabc4..afa138003f25571788d2b6ccc006019a3aae4771 100644 (file)
@@ -207,6 +207,9 @@ font_make_object (int size, Lisp_Object entity, int pixelsize)
     = (struct font *) allocate_pseudovector (size, FONT_OBJECT_MAX, PVEC_FONT);
   int i;
 
+  /* GC can happen before the driver is set up,
+     so avoid dangling pointer here (Bug#17771).  */
+  font->driver = NULL;
   XSETFONT (font_object, font);
 
   if (! NILP (entity))